package ss.cc.tt;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by Admin on 12/25 0025.
 */
@WebServlet(name = "ShoppingServlet",urlPatterns = "/shoppingServlet")
public class ShoppingServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String[] books=request.getParameterValues("book");
        request.getSession().setAttribute("books",books);
        response.sendRedirect(request.getContextPath()+"/shoppingcart/step_2.jsp");
    }
}
